home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #5 / Amiga Plus CD - 2000 - No. 5.iso / Tools / Dev / fpc / source / docs / dosex / ex9.pp < prev    next >
Encoding:
Text File  |  2000-01-01  |  509 b   |  31 lines

  1. Program Example9;
  2. uses Dos;
  3.  
  4. { Program to demonstrate the GetFTime function. }
  5.  
  6. Function L0(w:word):string;
  7. var
  8.   s : string;
  9. begin
  10.   Str(w,s);
  11.   if w<10 then
  12.    L0:='0'+s
  13.   else
  14.    L0:=s; 
  15. end;
  16.  
  17. var
  18.   f    : File;
  19.   Time : Longint;
  20.   DT   : DateTime;
  21. begin
  22.   Assign(f,ParamStr(1));
  23.   Reset(f);
  24.   GetFTime(f,Time);
  25.   Close(f);
  26.   UnPackTime(Time,DT);
  27.   Write ('File ',ParamStr(1),' is last modified on ');
  28.   Writeln (L0(DT.Month),'-',L0(DT.Day),'-',DT.Year,
  29.            ' at ',L0(DT.Hour),':',L0(DT.Min));
  30. end.
  31.